import http from '../utils/request';
//获取vip产品
export let getProductApi = (category_id) =>
  http.get('/product/get_product?category_id=' + category_id);
//vip下单
export let getPre_orderApi = (product_id) =>
  http.post('/order/pre_order?', {
    product_id
  });

//获取登陆日志
export let loginLogApi = () => http.get('/getloginlog');

//获取学员信息'
export let getStuListApi = (page, count, classes) =>
  http.get('/students/getstulist', {
    params: {
      page,
      count,
      classes
    }
  });

export let getAllUserApi = () => http.get('/users/getAllUsers');

//搜索学员请求
export let serchStuApi = (key, count, page) =>
  http.get('/students/searchstu', {
    params: {
      key,
      count,
      page
    }
  });

//增加学员
export let addStuListApi = (props = {}) => http.post('/students/addstu', props);

// 编辑学员信息
export let editStuApi = (props = {}) => http.post('/students/updatestu', props);

//删除学员信息
export let delStuApi = (sId) =>
  http.get('students/delstu', {
    params: {
      sId
    }
  });

//获取菜单权限请求
export let getMenuApi = () => http.get('/permission/getMenuList');

//查询当前用户订单信息
export let getOrderApi = (order_id = '') =>
  http.post('/order/get_order', {
    order_id
  });

//获取商品用户信息
export let OrderApi = (product_id) =>
  http.get('/product/get_product?product_id=' + product_id);

//下单
export let payMentApi = (product_id, quantity = 1) =>
  http.post('/order/pre_order', {
    product_id,
    quantity
  });

//发起支付
export let sendPayment = (order_id) =>
  http.post('/pay/payment', {
    order_id
  });

//查询支付结果
export let QueryOrderStatusApi = (order_id) =>
  http.get('/order/query_order_status?order_id=' + order_id);
